<template>
  <base-option :selected="selected" :field-config="fieldConfig" :form-config="formConfig">
    <template #default="{ hideOptions }">
      <el-form-item v-if="fieldConfig.inline !== undefined && hideOptions('inline')" label="排列方式">
        <el-radio-group v-model="fieldConfig.inline" class="ep-setting-panel-container__radio-group">
          <el-radio-button label="水平排列" :value="true" />
          <el-radio-button label="垂直排列" :value="false" />
        </el-radio-group>
      </el-form-item>

      <option-items
        v-if="fieldConfig.optionItems !== undefined"
        :selected="selected"
        :field-config="fieldConfig"
        :form-config="formConfig"
      />
    </template>
  </base-option>
</template>

<script setup>
import { toRefs } from 'vue'
import baseOption from './base-option.vue'
import optionItems from '../option-items.vue'
import propsDefinition from './props'
const props = defineProps(propsDefinition)
const { selected, fieldConfig, formConfig } = toRefs(props)
</script>
